3.11.7 \(\int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx\) [1007]

Optimal. Leaf size=140 \[ -\frac {(a-b x)^{-n} (a+b x)^{1+n}}{x}+\frac {b (1+2 n) (a-b x)^{-n} (a+b x)^n \, _2F_1\left (1,-n;1-n;\frac {a-b x}{a+b x}\right )}{n}-\frac {2^n b (a-b x)^{-n} (a+b x)^n \left (\frac {a+b x}{a}\right )^{-n} \, _2F_1\left (-n,-n;1-n;\frac {a-b x}{2 a}\right )}{n} \]

[Out]

-(b*x+a)^(1+n)/x/((-b*x+a)^n)+b*(1+2*n)*(b*x+a)^n*hypergeom([1, -n],[1-n],(-b*x+a)/(b*x+a))/n/((-b*x+a)^n)-2^n
*b*(b*x+a)^n*hypergeom([-n, -n],[1-n],1/2*(-b*x+a)/a)/n/((-b*x+a)^n)/(((b*x+a)/a)^n)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {130, 72, 71, 98, 133} \begin {gather*} \frac {b (2 n+1) (a+b x)^n (a-b x)^{-n} \, _2F_1\left (1,-n;1-n;\frac {a-b x}{a+b x}\right )}{n}-\frac {b 2^n (a+b x)^n \left (\frac {a+b x}{a}\right )^{-n} (a-b x)^{-n} \, _2F_1\left (-n,-n;1-n;\frac {a-b x}{2 a}\right )}{n}-\frac {(a+b x)^{n+1} (a-b x)^{-n}}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x)^(1 + n)/(x^2*(a - b*x)^n),x]

[Out]

-((a + b*x)^(1 + n)/(x*(a - b*x)^n)) + (b*(1 + 2*n)*(a + b*x)^n*Hypergeometric2F1[1, -n, 1 - n, (a - b*x)/(a +
 b*x)])/(n*(a - b*x)^n) - (2^n*b*(a + b*x)^n*Hypergeometric2F1[-n, -n, 1 - n, (a - b*x)/(2*a)])/(n*(a - b*x)^n
*((a + b*x)/a)^n)

Rule 71

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)/(b*(m + 1)*(b/(b*c
 - a*d))^n))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m, n}
, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] ||  !(Ra
tionalQ[n] && GtQ[-d/(b*c - a*d), 0]))

Rule 72

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Dist[(c + d*x)^FracPart[n]/((b/(b*c - a*d)
)^IntPart[n]*(b*((c + d*x)/(b*c - a*d)))^FracPart[n]), Int[(a + b*x)^m*Simp[b*(c/(b*c - a*d)) + b*d*(x/(b*c -
a*d)), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] &&  !IntegerQ[n] &&
(RationalQ[m] ||  !SimplerQ[n + 1, m + 1])

Rule 98

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(a +
b*x)^(m + 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + Dist[(a*d*f*(m + 1)
 + b*c*f*(n + 1) + b*d*e*(p + 1))/((m + 1)*(b*c - a*d)*(b*e - a*f)), Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*
x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && EqQ[Simplify[m + n + p + 3], 0] && (LtQ[m, -1] || Sum
SimplerQ[m, 1])

Rule 130

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_))^2, x_Symbol] :> Dist[b*(d/f^2),
 Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1), x], x] + Dist[(b*e - a*f)*((d*e - c*f)/f^2), Int[(a + b*x)^(m - 1)*(
(c + d*x)^(n - 1)/(e + f*x)^2), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[m + n, 0] && EqQ[2*b*d*e
- f*(b*c + a*d), 0]

Rule 133

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[(b*c - a
*d)^n*((a + b*x)^(m + 1)/((m + 1)*(b*e - a*f)^(n + 1)*(e + f*x)^(m + 1)))*Hypergeometric2F1[m + 1, -n, m + 2,
(-(d*e - c*f))*((a + b*x)/((b*c - a*d)*(e + f*x)))], x] /; FreeQ[{a, b, c, d, e, f, m, p}, x] && EqQ[m + n + p
 + 2, 0] && ILtQ[n, 0] && (SumSimplerQ[m, 1] ||  !SumSimplerQ[p, 1]) &&  !ILtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {(a-b x)^{-n} (a+b x)^{1+n}}{x^2} \, dx &=\left (2^{-n} (a-b x)^{-n} \left (\frac {a-b x}{a}\right )^n\right ) \int \frac {(a+b x)^{1+n} \left (\frac {1}{2}-\frac {b x}{2 a}\right )^{-n}}{x^2} \, dx\\ &=\frac {2^{-n} b (a-b x)^{-n} \left (\frac {a-b x}{a}\right )^n (a+b x)^{2+n} F_1\left (2+n;n,2;3+n;\frac {a+b x}{2 a},\frac {a+b x}{a}\right )}{a^2 (2+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.
time = 0.22, size = 146, normalized size = 1.04 \begin {gather*} \frac {(a-b x)^{-n} (a+b x)^n \left (-\frac {a^2 \left (1-\frac {a}{b x}\right )^n \left (1+\frac {a}{b x}\right )^{-n} F_1\left (1;n,-n;2;\frac {a}{b x},-\frac {a}{b x}\right )}{x}+\frac {2^n b (a-b x) \left (1+\frac {b x}{a}\right )^{-n} F_1\left (1-n;-n,1;2-n;\frac {a-b x}{2 a},1-\frac {b x}{a}\right )}{-1+n}\right )}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)^(1 + n)/(x^2*(a - b*x)^n),x]

[Out]

((a + b*x)^n*(-((a^2*(1 - a/(b*x))^n*AppellF1[1, n, -n, 2, a/(b*x), -(a/(b*x))])/((1 + a/(b*x))^n*x)) + (2^n*b
*(a - b*x)*AppellF1[1 - n, -n, 1, 2 - n, (a - b*x)/(2*a), 1 - (b*x)/a])/((-1 + n)*(1 + (b*x)/a)^n)))/(a*(a - b
*x)^n)

________________________________________________________________________________________

Maple [F]
time = 0.02, size = 0, normalized size = 0.00 \[\int \frac {\left (b x +a \right )^{1+n} \left (-b x +a \right )^{-n}}{x^{2}}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x)

[Out]

int((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x, algorithm="maxima")

[Out]

integrate((b*x + a)^(n + 1)/((-b*x + a)^n*x^2), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x, algorithm="fricas")

[Out]

integral((b*x + a)^(n + 1)/((-b*x + a)^n*x^2), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a - b x\right )^{- n} \left (a + b x\right )^{n + 1}}{x^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**(1+n)/x**2/((-b*x+a)**n),x)

[Out]

Integral((a + b*x)**(n + 1)/(x**2*(a - b*x)**n), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^(1+n)/x^2/((-b*x+a)^n),x, algorithm="giac")

[Out]

integrate((b*x + a)^(n + 1)/((-b*x + a)^n*x^2), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+b\,x\right )}^{n+1}}{x^2\,{\left (a-b\,x\right )}^n} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x)^(n + 1)/(x^2*(a - b*x)^n),x)

[Out]

int((a + b*x)^(n + 1)/(x^2*(a - b*x)^n), x)

________________________________________________________________________________________